/**
 * Company : Thai Informatic System Co., Ltd.
 * Created By : Chatree Siangklom
 * Created On : Feb 13, 2013  5:16:23 PM 
 * e-Mail : dr_chatree@hotmail.com
 * Mobile Phone : (+66) 087-921-5115
 * Package Name : jpa.service.promis.construction
 * File Name : VwSyncRequestPaymentDeductServices.java
 * TODO
 */
package jpa.service.promis.construction;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import jpa.entitys.promis.construction.VwSyncRequestPaymentDeduct;
import jpa.service.common.JPAService;

/**
 * @author chatree
 *
 */
public class VwSyncRequestPaymentDeductServices extends JPAService {

	/**
	 * @param em
	 */
	public VwSyncRequestPaymentDeductServices(EntityManager em) {
		super(em);
	}


	public VwSyncRequestPaymentDeduct findById(String id) throws Exception {		
	
		return super.ConvertToYoureObject(super.find(id, "VwSyncRequestPaymentDeduct.findById"));				
	}
	
	public List<VwSyncRequestPaymentDeduct> findAll() throws Exception {
		return super.ConvertToYoureObject(super.findAll("VwSyncRequestPaymentDeduct.findAll"));
	}
	
	public List<VwSyncRequestPaymentDeduct> findByDocumentNo(String company, String project ,String documentNo, String status) throws Exception {
		Map<String,Object> mapWhereValue = new HashMap<String, Object>();				
		mapWhereValue.put("company", company);
		mapWhereValue.put("project", project);
		mapWhereValue.put("documentNo", documentNo);
		//mapWhereValue.put("status", status);
		
		return super.ConvertToYoureObject(super.find("VwSyncRequestPaymentDeduct.findByDocumentNo1", mapWhereValue));
	}	
}
